StoredLearningSession.DeleteAttempt Method

Delete an existing attempt. This action permanently removes all data relating to this attempt from LearningStore. There is no way to recover deleted information.

Parent Type: StoredLearningSession

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public static void DeleteAttempt (
LearningStore learningStore,
AttemptItemIdentifier attemptId

)

Parameters

learningStore

The learningStore containing the attempt to be deleted.

attemptId

The unique identifier of the attempt to be deleted.

Exceptions
Exception type Condition
LearningStoreItemNotFoundException

Thrown if the attemptId does not represent a attempt.

ArgumentNullException

Thrown if learningStore is null.

Remarks

The method uses LearningStore.CreateJob and LearningStore.Execute methods to delete the attempt. Any exceptions thrown from those methods may be thrown from this method as well.

If there isn't a current transaction when this method is called then a new serializable transaction is created and used. If the job succeeds, the transaction is committed. If the job fails, the transaction is rolled back. If a SQL deadlock occurs when executing the job and the job is chosen as the deadlock victim, the job is retried several times.